视频播放器源码分享!可以直接调用在线音乐!
播放器效果示例:thread-5968318-1-1.html
sprite 219文件为简介编辑文件
sprite 194为替换代码文件
替换代码如下:
function loadsound(x)
{
played = 0;
aa = 0;
paused = false;
key = true;
s = new Sound();
s.loadSound(x, true);
trackname = id + 1 + "." + mp3name[id];
s.start();
s.onSoundComplete = function ()
{
id = id == mp3name.length - 1 ? (0) : (id + 1);
loadsound(mp3[id]);
};
mix.gotoAndStop(1);
cp.gotoAndPlay(1);
addList();
} // End of the function
function getid(i)
{
id = int(i);
addList();
clearInterval(poll);
loadsound(mp3[id]);
} // End of the function
function addList()
{
Name = "";
for (var _loc1 = 0; _loc1 < mp3name.length; ++_loc1)
{
num = int(_loc1) + 1;
num = num < 10 ? ("0" + num) : (num);
if (id != _loc1)
{
Name = Name + "<a href=\"asfunction:getid," + _loc1 + "\">" + num + "." + mp3name[_loc1] + "</a><BR>";
continue;
} // end if
Name = Name + "<a href=\"asfunction:getid," + _loc1 + "\"><font color=\"#00FF00\">" + num + "." + mp3name[_loc1] + "</font></a><BR>";
} // end of for
musicList.styleSheet = myStyleSheet;
musicList.htmlText = Name;
} // End of the function
function getPlaying()
{
} // End of the function
function setPlaying(state)
{
btn9._visible = state;
btn3._visible = !state;
} // End of the function
function dj_menu0()
{
getURL("http://bbs.voc.com.cn/forum-77-1.html", "_blank");
} // End of the function
function dj_menu1()
{
getURL("http://bbs.voc.com.cn/forum-77-1.html", "_blank");
} // End of the function
var j = 0;
var mp3name = ["卑微的荣耀 ", "漂流", "当我走过", "年轻的战场(2014摇滚版)"];
var mp3 = ["http://yinyueshiting.baidu.com/data2/music/123511174/123502529234000128.mp3?xcode=4dcd33ba7b890067bbcd70af7d8a31a28384490166ecd8df", "http://yinyueshiting.baidu.com/data2/music/123511300/1235025501412226061128.mp3?xcode=4dcd33ba7b890067bbcd70af7d8a31a2208af3a79d97f3ba", "http://yinyueshiting.baidu.com/data2/music/123511182/123502606252000128.mp3?xcode=4dcd33ba7b890067bbcd70af7d8a31a274cf820e0bab8e42", "http://yinyueshiting.baidu.com/data2/music/123503134/1235030461412197261128.mp3?xcode=4dcd33ba7b890067bbcd70af7d8a31a2791a29fbc3b3879b"];
var s = new Sound();
var id = 0;
var played = 0;
var key = true;
cssText = "a:link{text-decoration: none;font-size:8px;} a:hover{color:#DC143C; text-decoration: underline;font-size:8px;} a:active{color:#FFFF00;text-decoration: none;font-size:8px;}";
myStyleSheet = new TextField.StyleSheet();
myStyleSheet.parseCSS(cssText);
var Name;
addList();
this.addProperty("playing", getPlaying, setPlaying);
btn3._visible = false;
btn1.onPress = function ()
{
id = id == 0 ? (mp3name.length - 1) : (id - 1);
loadsound(mp3[id]);
};
btn2.onPress = function ()
{
if (key)
{
s.stop();
trackname = "STOP";
mix.gotoAndPlay(1);
cp.gotoAndStop(4);
played = 0;
key = false;
s = new Sound();
} // end if
playing = false;
};
btn9.onPress = function ()
{
if (key)
{
played = s.position;
s.stop();
mix.gotoAndPlay(1);
cp.gotoAndStop(4);
trackname = "PAUSED";
}
else
{
loadsound(mp3[id]);
} // end else if
playing = false;
};
btn3.onPress = function ()
{
if (key)
{
s.start(played / 1000, 1);
trackname = id + 1 + "." + mp3name[id];
mix.gotoAndStop(1);
cp.gotoAndPlay(1);
}
else
{
loadsound(mp3[id]);
} // end else if
playing = true;
};
btn4.onPress = function ()
{
id = id == mp3name.length - 1 ? (0) : (id + 1);
loadsound(mp3[id]);
};
btn5.onRelease = function ()
{
s.start(s.position / 1000 - 10, 1);
playing = true;
};
btn6.onRelease = function ()
{
s.start(s.position / 1000 + 10, 1);
playing = true;
};
loadsound(mp3[id]);
var time1 = time2 = time3 = time4 = 0;
var yyy = yyt._x;
this.onEnterFrame = function ()
{
l = s.getBytesLoaded();
loading._width = l / m * 313;
m = s.getBytesTotal();
b = int(l / m * 100);
txt1 = b + "%";
txt2 = int(l / 1000) / 1000 + "m" + " | " + int(m / 1000) / 1000 + "m";
time1 = int(s.position / 60000) < 10 ? ("0" + int(s.position / 60000)) : (int(s.position / 60000));
time2 = int(s.position / 1000 % 60) < 10 ? ("0" + int(s.position / 1000 % 60)) : (int(s.position / 1000 % 60));
time3 = int(s.duration / 60000) < 10 ? ("0" + int(s.duration / 60000)) : (int(s.duration / 60000));
time4 = int(s.duration / 1000 % 60) < 10 ? ("0" + int(s.duration / 1000 % 60)) : (int(s.duration / 1000 % 60));
timeline = time1 + ":" + time2 + " | " + time3 + ":" + time4;
aa = s.position;
bb = s.duration;
yyt._x = int(aa) / int(bb) * 313 + yyy;
if (int(s.position) <= 1000)
{
ldmc.play();
aa = aa + 1;
if (aa >= 300)
{
ldmc.gotoAndStop(11);
} // end if
}
else
{
ldmc.gotoAndStop(10);
ldmc.preload._width = l / m * 118;
} // end else if
};
Stage.scaleMode = "noScale";
expandmenu = new ContextMenu();
expandmenu.hideBuiltInItems();
expandmenu.customItems.push(new ContextMenuItem("色中色论坛音乐区欢迎您的光临!", dj_menu0, true, true));
expandmenu.customItems.push(new ContextMenuItem("资料来源于网络 PP收集整理", dj_menu1, true, true));
_root.menu = expandmenu;
stop ();
源文件下载:http://www.pipipan.com/file/74914725